import Vue from 'vue'
import App from './App.vue'
import index from './views/index.vue'
import classification from './views/classification.vue'
import order from './views/order.vue'
import my from './views/my.vue'
import NotFound from './views/NotFound.vue'
// 引入VueRouter
import VueRouter from 'vue-router'
Vue.config.productionTip = false
// 装插件将构造函数VueRouter加载到Vue上
Vue.use(VueRouter)
// 配置路由规则
let routes =
  [
    { path: '/', redirect: '/index' },
    { path: '/index', component: index },
    { path: '/classification', component: classification },
    { path: '/order', component: order },
    { path: '/my', component: my },
    { path: '*', component: NotFound },
  ];
  // 添加美化样式
let router = new VueRouter({ routes,mode:'history' })
new Vue({
  render: h => h(App),
  router
}).$mount('#app')
